package com.czy.test;

import cn.hutool.json.JSONUtil;
import cn.hutool.script.ScriptRuntimeException;
import cn.hutool.script.ScriptUtil;
import com.czy.workflow.core.model.FlowNode;
import com.czy.workflow.core.model.TaskInfo;
import org.junit.Test;

import javax.script.CompiledScript;
import javax.script.ScriptException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Main {


    @Test
    public void test1(){
//        FlowNode selector = new FlowNode();
//        selector.setId("xxx");
//        selector.setName("x");
//        TaskInfo taskInfo = new TaskInfo();
//        taskInfo.setNode(selector);
//        String jsObj = JSONUtil.toJsonStr(taskInfo);
//        String exp = "var task = " + jsObj + "; print(JSON.stringify(task.selector));";
//        CompiledScript script = ScriptUtil.compile(exp);
//        try {
//            Object result = script.eval();
//            System.out.println(result);
//            System.out.println(result == Boolean.TRUE);
//        } catch (ScriptException e) {
//            throw new ScriptRuntimeException(e);
//        }

    }



}
